<!DOCTYPE html>
<html>
<head>
    <style>
  .big-font {
    font-size: 50px; /* 设置字体大小为24像素 */
  }


    </style>
</head>
<body>
<p id="locationInfo" class="big-font">位置信息</p>
<button onclick="getLocation()" class="big-font">获取位置</button>
<script>
var locationInfo=document.getElementById("locationInfo");
function getLocation(){
  if (navigator.geolocation) {
    <!-- 前端页面访问设备地理位置 -->
    navigator.geolocation.getCurrentPosition(showPosition);
  }
}
function showPosition(position){
  locationInfo.innerHTML="Latitude: " + position.coords.latitude + "<br />Longitude: " + position.coords.longitude;
}



</script>
</body>
</html>